package com.zhuliwei.entity;

import com.zhuliwei.exception.RecognitionException;

import java.util.ArrayList;
import java.util.List;

/**
 * 最终识别结果
 *
 * @author 朱力维
 * @time 2025/3/21 13:56
 **/
public class RecognitionResult {
        private boolean successful;                   // 没有任何异常时为 true
        private List<RecognitionItem> items;          // 识别出的商品清单（允许 empty，但不允许 null）
        private List<RecognitionException> exceptions; // 识别过程中记录的异常（允许 empty，但不允许 null）

        public RecognitionResult() {
            this.successful = true;
            this.items = new ArrayList<>();
            this.exceptions = new ArrayList<>();
        }

        public boolean isSuccessful() {
            return successful;
        }

        public void setSuccessful(boolean successful) {
            this.successful = successful;
        }

        public List<RecognitionItem> getItems() {
            return items;
        }

        public void setItems(List<RecognitionItem> items) {
            this.items = items;
        }

        public List<RecognitionException> getExceptions() {
            return exceptions;
        }

        public void setExceptions(List<RecognitionException> exceptions) {
            this.exceptions = exceptions;
        }
}